import request from "@/utils/request";


/**
 * 获取翻译文章详情
 * @param articleId
 * @returns {Promise | Promise<unknown>}
 */
export function getArticleById(articleId){
  return request({
    url: '/translate/getArticleById',
    method: 'get',
    params:{
      id:articleId,
    }
  })
}

/**
 * 审批文章
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export function updateTranslate(params) {
  return request({
    url: '/translate/updateTranslate',
    method: 'post',
    data:params
  })

}


/**
 * 获取翻译文章列表
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export function getArticleList(params) {
  return request({
    url: '/translate/getArticleList',
    method: 'get',
    params:params
  })
}

export function getDraftList(params){
  return request({
    url : '/draft/getDraftList',
    method : 'get',
    params,
  });
}



/**
 * 获取翻译的数据统计
 * @returns {Promise | Promise<unknown>}
 */
export function getTranslatorStatistics(){
  return request({
    url: '/translate/getIndexStatistics',
    method: 'get',
  })
}

/**
 * 领取任务
 * @param id
 * @returns {Promise | Promise<unknown>}
 */
export function getArticleTranslateTask(id){
  return request({
    url: '/translate/getArticleTranslateTask',
    method: 'post',
    data:{
      id:id
    }
  })
}

/**
 * 获取翻译人的明细
 * @param params
 * @returns {Promise | Promise<unknown>}
 */
export function getTranslatorDetail(params = {}){
  return request({
    url: '/admin/translator/getTranslatorDetail',
    method: 'get',
    params:params,
  })
}

